<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title>test</title>
</head>

<body>
    <button data-event="test">在顶层页打开对话框</button> <button data-event="reload">刷新本框架页</button>
    <div id="value"></div>
    <script src="../../lib/jquery-1.10.2.js"></script>
    <script>
        // demo
        window.console = window.console || {
            log: function() {}
        }

        $('button[data-event=test]').on('click', function() {
            top.dialog({
                    id: 'test-dialog',
                    title: 'loading..',
                    url: './dialog-content.html',
                    //quickClose: true,
                    onshow: function() {
                        console.log('onshow');
                    },
                    oniframeload: function() {
                        console.log('oniframeload');
                    },
                    onclose: function() {
                        if (this.returnValue) {
                            $('#value').html(this.returnValue);
                        }
                        console.log('onclose');
                    },
                    onremove: function() {
                        console.log('onremove');
                    }
                })
                .show(this);
            return false;
        });

        $('button[data-event=reload]').on('click', function() {
            location.reload();
            return false;
        });
    </script>
</body>

</html>